<template>
	<div class="spec-preview">
		<vue-photo-zoom-pro 
			:high-url="imageList[index].imgUrl"
			:scale="2"
			:width="200"
			:height="200"
			:out-zoomer="true"
			:mask="true"
			mask-color="inherit"
		>
			<img :src="imageList[index].imgUrl" />
		</vue-photo-zoom-pro>
	</div>
</template>

<script>
	import vuePhotoZoomPro from 'vue-photo-zoom-pro'
	import 'vue-photo-zoom-pro/dist/style/vue-photo-zoom-pro.css'
  export default {
    name: "Zoom",
		props:['imageList'],
		data() {
			return {
				index:0
			}
		},
		components:{vuePhotoZoomPro},
		mounted() {
			this.$bus.$on('send-img-index',(index)=>{
				this.index = index
			})
		},
  }
</script>

<style lang="less">
  .spec-preview {
    position: relative;
    width: 400px;
    height: 400px;
    border: 1px solid #ccc;

    img {
      width: 100%;
      height: 100%;
    }

  }
	.zoomer{
		top: 0 !important;
	}
	.selector{
		background-color: rgba(255, 0, 0, 0.226) !important;
	}
</style>